

package jetbrains.buildServer.server.rest.errors;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
import jetbrains.buildServer.server.rest.jersey.ExceptionMapperBase;
import jetbrains.buildServer.serverSide.MissingServerResponsibilityException;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Component;

@Provider
@Component
public class MissingServerResponsibilityExceptionMapper extends ExceptionMapperBase<MissingServerResponsibilityException> {
  @Override
  public ResponseData getResponseData(@NotNull MissingServerResponsibilityException e) {
    return new ResponseData(Response.Status.BAD_REQUEST, "This TeamCity node is not allowed to perform this action.");
  }
}